package myself;

import java.sql.SQLException;
import java.util.List;

import jdbc.JDBCUtils;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import mybeans.Beans;

public class MyselfService {

	public List<Beans> getMyGoods(String userID) {
		QueryRunner qr = new QueryRunner(JDBCUtils.getDs());
		String sql = "select * from MyGoods, Goods where MyGoods.goodsID = Goods.goodsID and userID = ? ";
		try {
			return qr.query(sql, userID, new BeanListHandler<>(Beans.class));
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

}
